<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>IDM 激活脚本管理器</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }
        .main-container {
            max-width: 800px;
            margin: 50px auto;
            padding: 20px;
        }
        .card {
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            border: none;
            border-radius: 10px;
        }
        .btn-activate {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            padding: 15px 40px;
            font-size: 18px;
            border-radius: 50px;
            transition: all 0.3s ease;
        }
        .btn-activate:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
        }
        .log-area {
            background-color: #1e1e1e;
            color: #d4d4d4;
            font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
            font-size: 14px;
            padding: 15px;
            border-radius: 5px;
            max-height: 300px;
            overflow-y: auto;
            white-space: pre-wrap;
        }
        .version-badge {
            font-size: 14px;
            padding: 5px 15px;
        }
        .status-indicator {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            display: inline-block;
            margin-right: 8px;
        }
        .status-online { background-color: #28a745; }
        .status-offline { background-color: #dc3545; }
        .status-checking { background-color: #ffc107; }
    </style>
</head>
<body>
    <div class="main-container">
        <div class="text-center mb-4">
            <h1 class="display-5 fw-bold text-primary">
                <i class="fas fa-download"></i> IDM 激活脚本管理器
            </h1>
            <p class="text-muted">一键下载并激活 Internet Download Manager</p>
        </div>

        <div class="card mb-4">
            <div class="card-body text-center">
                <div class="mb-3">
                    <span class="badge bg-secondary version-badge">
                        <i class="fas fa-code-branch"></i> 脚本版本: <span id="currentVersion">检测中...</span>
                    </span>
                    <span class="badge bg-success version-badge ms-2">
                        <span class="status-indicator status-checking" id="statusIndicator"></span>
                        <span id="updateStatus">检查更新中...</span>
                    </span>
                </div>
                
                <button class="btn btn-primary btn-activate" id="activateBtn" disabled>
                    <i class="fas fa-magic"></i> 一键激活 IDM
                </button>
                
                <div class="mt-3">
                    <small class="text-muted">
                        <i class="fas fa-shield-alt"></i> 安全提示：脚本将在本地运行，不会上传任何数据
                    </small>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-header">
                <h5 class="mb-0">
                    <i class="fas fa-terminal"></i> 执行日志
                </h5>
            </div>
            <div class="card-body">
                <div class="log-area" id="logArea">
                    [系统] 正在初始化 IDM 激活脚本管理器...
                    [系统] 正在检查脚本版本...
                </div>
                <div class="mt-3">
                    <button class="btn btn-sm btn-outline-secondary" onclick="clearLog()">
                        <i class="fas fa-trash"></i> 清空日志
                    </button>
                    <button class="btn btn-sm btn-outline-primary" onclick="refreshLog()">
                        <i class="fas fa-sync"></i> 刷新日志
                    </button>
                </div>
            </div>
        </div>

        <div class="text-center mt-4">
            <small class="text-muted">
                <i class="fas fa-info-circle"></i> 使用说明：点击"一键激活"按钮后，系统将下载激活脚本并提示您运行
            </small>
        </div>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js"></script>
    <script src="script.js"></script>
</body>
</html>